home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Container Common / xbinding.h < prev   
Text File  |  1997-01-03  |  3KB  |  120 lines

  1. //
  2. //  XBINDING.H
  3. //
  4. //  Copyright (C) Microsoft Corporation, 1996
  5. //
  6.  
  7. extern OLECHAR g_szBSCBHolder[];
  8.  
  9. class CXBinding:
  10.     public IBinding
  11. {
  12. private:
  13.     ULONG m_cRef;
  14. #ifndef URLMON_DLL
  15.     CXSite *m_pSite;
  16. #endif
  17.  
  18. public:
  19.     LPBINDSTATUSCALLBACK m_pbsc;
  20.     BOOL m_fAborted;
  21.  
  22. public:
  23. #ifdef URLMON_DLL
  24.     inline CXBinding(void);
  25. #else
  26.     inline CXBinding(CXSite *pSite);
  27. #endif
  28.     ~CXBinding();
  29.  
  30.     HRESULT Bind(LPOLESTR pszURL, LPBINDSTATUSCALLBACK pbsc, unsigned long BindType);
  31.  
  32.     //  *** IUnknown methods ***
  33.     STDMETHOD(QueryInterface)(REFIID riid, LPVOID *ppvObj);
  34.     STDMETHOD_(ULONG, AddRef)(void);
  35.     STDMETHOD_(ULONG, Release)(void);
  36.  
  37.     //  *** IBinding methods ***
  38.     STDMETHOD(Abort)(void);
  39.     STDMETHOD(Suspend)(void);
  40.     STDMETHOD(Resume)(void);
  41.     STDMETHOD(SetPriority)(LONG nPriority);
  42.     STDMETHOD(GetPriority)(LONG *pnPriority);
  43.     STDMETHOD(GetBindResult)(LPCLSID pclsidProtocol, LPDWORD pdwResult, LPOLESTR
  44.         *pszResult, LPDWORD pdwReserved);
  45. };
  46.  
  47. inline
  48. #ifdef URLMON_DLL
  49. CXBinding::CXBinding(void)
  50. #else
  51. CXBinding::CXBinding(CXSite *pSite)
  52. #endif
  53. {
  54.     m_cRef = 1;
  55.     m_pbsc = NULL;
  56.     m_fAborted = false;
  57. #ifndef URLMON_DLL
  58.     m_pSite = pSite;
  59. #endif
  60. }
  61.  
  62. class CBindingMemoryStreamNotify:
  63.     public CMemoryOleStreamNotify
  64. {
  65. private:
  66.     //  Back pointer to the binding object that created this stream.
  67.     CXBinding *m_pBinding;
  68.  
  69.     BOOL m_fDeliveredFirstNotify;
  70.  
  71. public:
  72.     inline CBindingMemoryStreamNotify(CXBinding *pBinding);
  73.  
  74.     virtual int32 OnWrite(NPStream *stream, int32 offset, int32 len, void
  75.         *buffer);
  76.     virtual NPError OnDestroyStream(NPStream *stream, NPError reason);
  77. };
  78.  
  79. inline
  80. CBindingMemoryStreamNotify::CBindingMemoryStreamNotify(CXBinding *pBinding)
  81. {
  82.     //  Our implementation of the "new" operator will zero the structure so we
  83.     //  don't have to explicitly zero/null anything.
  84.     m_pBinding = pBinding;
  85. }
  86.  
  87. class CBindingFileStreamNotify:
  88.     public CNetscapeStreamNotify,
  89.     public IUnknown
  90. {
  91. private:
  92.     ULONG m_cRef;
  93.     //  Back pointer to the binding object that created this stream.
  94.     CXBinding *m_pBinding;
  95.     unsigned long    mBindType;
  96.  
  97. public:
  98.     inline CBindingFileStreamNotify(CXBinding *pBinding, unsigned long BindType);
  99.  
  100.     virtual NPError OnNewStream(NPMIMEType type, NPStream *stream, NPBool
  101.         seekable, uint16 *stype);
  102.     virtual void OnStreamAsFile(NPStream *stream, const char* fname);
  103.     virtual NPError OnDestroyStream(NPStream *stream, NPError reason);
  104.  
  105.     //  *** IUnknown methods ***
  106.     STDMETHOD(QueryInterface)(REFIID riid, LPVOID *ppvObj);
  107.     STDMETHOD_(ULONG,AddRef)(void);
  108.     STDMETHOD_(ULONG,Release)(void);
  109. };
  110.  
  111. inline
  112. CBindingFileStreamNotify::CBindingFileStreamNotify(CXBinding *pBinding, unsigned long BindType)
  113. {
  114.     //  Our implementation of the "new" operator will zero the structure so we
  115.     //  don't have to explicitly zero/null anything.
  116.     m_cRef = 1;
  117.     m_pBinding = pBinding;
  118.     mBindType = BindType;
  119. }
  120.